package com.biz.primus.model.payment.enums;


import com.biz.primus.common.enums.EnumerableValue;
import com.biz.primus.common.enums.converter.BaseEnumValueConverter;

/**
 * 支付类型
 * (交易类型)
 */
public enum PaymentType implements EnumerableValue {

    ALIPAY(10, "支付宝"),

    WECHAT(20, "微信"),

    WALLET(30, "电子钱包"),

    ALL_IN_PAY_JS_API(35, "通联支付(公众号&服务窗)"),

    ALL_IN_PAY(40, "通联支付(正扫)"),

    ALL_IN_SCAN_PAY(50, "通联支付(反扫)"),

    ALL_IN_PAY_CARD(60, "卡云");


    public static PaymentType valueOf(Integer type) {
        if (type == ALIPAY.getValue()) {
            return ALIPAY;
        } else if (type == WECHAT.getValue()) {
            return WECHAT;
        }
        return null;
    }

    public static class Converter extends BaseEnumValueConverter<PaymentType> {
    }

    private int value;

    private String desc;

    @Override
    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    PaymentType(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }


}
